home *** CD-ROM | disk | FTP | other *** search
/ Transactor / Transactor_03_1985_Transactor_Publishing.d64 / home budget (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  4KB  |  151 lines

  1. 0 rem the transactor volume 5 issue 04 page 46
  2. 1 rem this version modified from the listing printed
  3. 100 rem*********************
  4. 110 rem*                   *
  5. 120 rem*    home budget    *
  6. 130 rem*        by         *
  7. 140 rem*    brian dobbs    *
  8. 150 rem*                   *
  9. 160 rem*  timmins,ontario  *
  10. 170 rem*                   *
  11. 180 rem*********************
  12. 190 poke53280,11:poke53281,0:dima$(13,13),dt$(12):print""
  13. 200 for i=1to12:read dt$(i):next i
  14. 210 goto290
  15. 220 gosub1420: if kk then 290
  16. 230 open14,8,14,"0:"+nm$+",s,r"
  17. 240 for x=1 to 13
  18. 250 for y=2 to 13: input#14,a$(x,y)
  19. 260 next y,x
  20. 270 close14
  21. 280 :
  22. 290 print"[147]"tab(14)"budget menu"
  23. 300 printtab(14)"[183][183][183][183][183][183][183][183][183][183][183]"
  24. 310 printtab(10)"1[146]-write monthly bills":print""
  25. 320 printtab(10)"2[146]-view monthly bills":print""
  26. 330 printtab(10)"3[146]-barchart trend of bills":print""
  27. 340 printtab(10)"4[146]-printer trend of bills":print""
  28. 350 printtab(10)"5[146]-save data to disk":print""
  29. 360 printtab(10)"6[146]-load data from disk":print""
  30. 370 printtab(10)"7[146]-create initial file":print""
  31. 380 printtab(10)"select choice (1-7)":y=0
  32. 390 getan$:ifan$=""then390
  33. 400 forx=1to7:ifan$=mid$("1234567",x,1)theny=x
  34. 410 next:onygoto550,420,660,940,1180,220,1220:goto290
  35. 420 print"[147]":gosub1270
  36. 430 input"enter month to view (0=menu)";x
  37. 440 if x=0 then 290
  38. 450 x=x+1
  39. 460 print"[147]"
  40. 470 fory=2to13:print a$(1,y):next y
  41. 480 print"[145][145][145][145][145][145][145][145][145][145][145][145][145]"
  42. 490 fory=2to13:printtab(15)a$(x,y):nexty
  43. 500 gosub1500
  44. 510 print"monthly total"tab(14)q+aa+bb
  45. 520 geta$:ifa$=""then520
  46. 530 goto420
  47. 540 :
  48. 550 print"[147]":gosub1270
  49. 560 input"what month to write bills (0=menu)";x
  50. 570 if x=0 then 290
  51. 580 x=x+1:print"[147]"
  52. 590 printtab(15)dt$(x-1)""
  53. 600 for y=2 to 13:printa$(1,y):next y
  54. 610 print"[145][145][145][145][145][145][145][145][145][145][145][145][145]"
  55. 620 fory=2to13:printtab(15):inputa$(x,y)
  56. 630 next y
  57. 640 goto 550
  58. 650 :
  59. 660 print"[147]"
  60. 670 for p=2to13
  61. 680 print""p-1"[146])"a$(1,p)
  62. 690 next p
  63. 700 input"enter number of desired bill";y:y=y+1
  64. 710 print"what is maximum scale for "a$(1,y);:input b
  65. 720 print"[147]":printtab(20-(len(a$(1,y))/2))a$(1,y)
  66. 730 print""b:z=0
  67. 740 z=z+(b/20):ifz=bthen760
  68. 750 printint(b-z):goto740
  69. 760 r=1992:x=2:t=56264:u=2
  70. 770 fore=rtor-(40*((val(a$(x,y))/(b/20))))step-40
  71. 780 ife>1023ande<2024thenpokee,224
  72. 790 next
  73. 800 forf=ttot-(40*((val(a$(x,y))/(b/20))))step-40
  74. 810 iff>55295andf<56296thenpokef,u
  75. 820 next
  76. 830 r=r+2:x=x+1:t=t+2:u=u+1
  77. 840 ifu=3thenu=1
  78. 850 ifx=14then870
  79. 860 goto770
  80. 870 r=1992:t=56264:poker,138:poket,1:poker+2,134:poket+2,1:poker+4,141
  81. 880 poket+4,1:poker+6,129:poket+6,1:poker+8,141:poket+8,1:poker+10,138
  82. 890 poket+10,1:poker+12,138:poket+12,1:poker+14,129:poket+14,1:poker+16,147
  83. 900 poket+16,1:poker+18,143:poket+18,1:poker+20,142:poket+20,1:poker+22,132
  84. 910 poket+22,1
  85. 920 geta$:ifa$=""then920
  86. 930 goto290
  87. 940 open4,4:print#4,tab(38)"budget 1984":print#4:l=2:m=7
  88. 950 print#4," bill               ";
  89. 960 print#4,"january   febuary   march     april     may       june"
  90. 970 gosub1060
  91. 980 l=2:m=7
  92. 990 gosub1100
  93. 1000 l=8:m=13:print#4," bill               ";
  94. 1010 print#4,"july      august    september october   november  december"
  95. 1020 gosub1060
  96. 1030 l=8:m=13
  97. 1040 gosub1100
  98. 1050 close4:restore:goto290
  99. 1060 fory=1to13:z=20-len(a$(1,y))
  100. 1070 print#4,a$(1,y)tab(z);
  101. 1080 fori=ltom:print#4,(a$(i,y))tab(10-len(a$(i,y)));:nexti:print#4,chr$(10)
  102. 1090 nexty:print#4:return
  103. 1100 print#4,"monthly total"tab(6)
  104. 1110 forx=ltom
  105. 1120 gosub1500
  106. 1130 c=q+aa+bb:c$=str$(c)
  107. 1140 print#4,q+aa+bbtab(9-len(c$));:nextx
  108. 1150 print#4,chr$(10)
  109. 1160 return
  110. 1170 :
  111. 1180 gosub1420: if kk then 290
  112. 1190 open14,8,14,"@0:"+nm$+",s,w"
  113. 1200 goto 1380
  114. 1210 :
  115. 1220 print"[147]  a total of 12 bills will be entered.": xx=fre(0)
  116. 1230 for y=2 to 13
  117. 1240 print"name of bill";y-1;:input a$(1,y)
  118. 1250 next y: goto1320
  119. 1260 :
  120. 1270 for w=1to12
  121. 1280 print""w"[146])"dt$(w)
  122. 1290 next w
  123. 1300 return
  124. 1310 :
  125. 1320 print"[147]"
  126. 1330 for x=2to13:for y=2to13
  127. 1340 a$(x,y)="0": next y,x: xx=fre(0)
  128. 1350 gosub 1420 'get filename
  129. 1360 open14,8,14,"0:"+nm$+",s,w"
  130. 1370 print"  creating initial file[146]"
  131. 1380 for x=1to 12: for y=2 to 13
  132. 1390 print#14,a$(x,y): next y,x
  133. 1400 close14:goto290
  134. 1410 :
  135. 1420 input"[147]  filename[146]";nm$
  136. 1430 print" press 'f1[146]' to continue"
  137. 1440 geta$:ifa$=""then1440
  138. 1450 kk=(a$<>chr$(133)):rem f1 key
  139. 1460 return
  140. 1470 :
  141. 1480 data january,february,march,april,may,june,july,august,september,october
  142. 1490 data november,december
  143. 1500 q=(val(a$(x,2)))+(val(a$(x,3)))+(val(a$(x,4)))+(val(a$(x,5)))
  144. 1510 aa=(val(a$(x,6)))+(val(a$(x,7)))+(val(a$(x,8)))+(val(a$(x,9)))
  145. 1520 bb=(val(a$(x,10)))+(val(a$(x,11)))+(val(a$(x,12)))+(val(a$(x,13)))
  146. 1530 return
  147. 1540 :
  148. 1550 fori=1to12
  149. 1560 print""i"[146])"a$(1,i)
  150. 1570 next i: return
  151.